Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
@oclif/errors
Advanced tools
The @oclif/errors npm package is designed to handle errors within the oclif (Open CLI Framework) ecosystem. It provides a structured way to create and manage errors in command-line applications built with oclif. The package allows developers to define custom error types, handle errors gracefully, and display user-friendly error messages.
CLIError
CLIError is a custom error type provided by @oclif/errors for general command-line interface errors. It can be used to throw errors with a message that will be displayed to the user.
const { CLIError } = require('@oclif/errors');
throw new CLIError('Something went wrong!');
ExitError
ExitError is a custom error type that can be used to exit the process with a specific exit code. This is useful for signaling to the shell or parent process that the command failed with a particular error state.
const { ExitError } = require('@oclif/errors');
throw new ExitError(1);
handle
The handle function is used to catch and handle errors gracefully within an oclif application. It can be used to intercept uncaught exceptions and display a user-friendly message or perform cleanup before exiting.
const { handle } = require('@oclif/errors');
process.on('uncaughtException', error => {
handle(error);
});
Yargs is a powerful npm package that helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It comes with built-in error handling and can be used as an alternative to @oclif/errors for managing command-line arguments and errors.
Commander is another npm package for building command-line applications. It provides error handling capabilities similar to @oclif/errors, but it is more focused on parsing command-line options and subcommands rather than providing a structured error handling system.
Chalk is a popular npm package for styling terminal text. While it does not provide structured error handling like @oclif/errors, it can be used in conjunction with other error handling packages to display colorful and styled error messages in the terminal.
This library has been replaced by @oclif/core and is now in maintenance mode. We will only consider PRs that address security concerns.
display friendly CLI errors and log to error log
FAQs
display friendly CLI errors and log to error log
The npm package @oclif/errors receives a total of 984,260 weekly downloads. As such, @oclif/errors popularity was classified as popular.
We found that @oclif/errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.